﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class OutSourcing : System.Web.UI.Page
{
    //creamos el dataset que contendra las tablas
    DataSet ds = new DataSet();
    protected void Page_Load(object sender, EventArgs e)
    {
        //llenamos el dataset con los datos de la tablas de Outsourcing
        Outs.Outsourcing O = new Outs.Outsourcing();
        ds = O.ConsultaOutSourcing();
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {   //creamos el objeto tabla para llenar una nueva fila
        DataTable TOut = ds.Tables["Outsourcing"];
        DataRow row = TOut.NewRow();
        //ingrasamos los datos de la fila
        row["IdOutsourcing"] = ds.Tables["Outsourcing"].Rows.Count + 1;
        row["Nombre"] = txtOutnombre.Text;
        row["NombreComercial"] = TxtOutNomCom.Text;
        row["NoRegistro"] = TxtOutReg.Text;
        row["CodigoTributario"] = TxtOutNumTri.Text;
        row["Giro"] = TxtOutGiro.Text;
        row["Direccion"] = OutDirecion.Text;
        row["Telefono"] = TxtOutTel.Text;
        row["Fax"] = TxtOutFax.Text;
        row["Contacto"] = TxtOutContacto.Text;
        row["WWW"] = TxtOutPagWeb.Text;
        row["Descripcion"] = txtOutDes.Text;
        row["Email"] = TxtOutcorreoElectronico.Text;


        ds.Tables["Outsourcing"].Rows.Add(row);

        Outs.Outsourcing cl = new Outs.Outsourcing();
        cl.DatoOutSourcing(ds);
        ds.AcceptChanges();

    }
    
}